function localization_init ( alg_param )
    global nodes_count;
    global S_Map;
    global N_Map;
    global radio_range;
    global D_Map;
    
    % nasze zmienne globalne
    global g1400_gps_count;
    global g1400_epsilon;
    global g1400_gamma;
    global g1400_k;
    global g1400_DDMap;
    global g1400_finished;
    global g1400_LMap;
    global g1400_LMap_next;
    global g1400_prog1;
    global g1400_prog2;
    
    g1400_finished = 0;

    g1400_gps_count = 30;
    g1400_epsilon = 10; 
    g1400_gamma = 0.30; % niecale 10 stopni 
    g1400_k = 20; % procent wstrzykiwanego bledu 
    g1400_prog1 = 2;
    g1400_prog2 = 200;
    
    g1400_DDMap = D_Map; % macierz odleglosci z wstrzyknietym bledem
    for i = 1:nodes_count
        for j = 1:nodes_count
            err = randi([-g1400_k,g1400_k])/100;
            g1400_DDMap(i,j) = g1400_DDMap(i,j) * (1+err);
        end
    end
    
    %
    % LMap(:,1) - status (1 - obrabiamy, 0 - omijamy)
    % LMap(:,2) - rodzaj wezla (0 - do niczego, 1 - kotwica, 2 - latarnia)
    % LMap(:,3) - x
    % LMap(:,4) - y
    % LMap(:,5) - e
    %
    g1400_LMap_next = zeros(nodes_count,5);
    g1400_LMap_next (:,5) = 10000000;
    
    % losujemy te z gpsem
    tmp = g1400_gps_count;
    while tmp > 0
        n = randi([0,nodes_count]);
        if (g1400_LMap_next(n,2) == 0)
            g1400_LMap_next(n,2) = 2; % ustawienie ze ten wezel jest latarnia
            g1400_LMap_next(n,3) = S_Map(n,1);
            g1400_LMap_next(n,4) = S_Map(n,2);
            g1400_LMap_next(n,5) = 0; % zerowy blad dla gps
            % powiadomienie sasiadow
            emit_data(n, false);
            
            L = N_Map(n,1,1);
            for i= 2:L+1
               id = N_Map(n,i,1);
               if (id == 0) % id=0 to stacja bazowa (?) - pomijamy w naszych rozwazaniach
                   %N_Map(n,:,1)
                   %i
                   continue
               end
               recv_data(id);
               g1400_LMap_next(id,1) = 1;
           end
           tmp = tmp - 1;
           localization_draw_point(n, -1);
           % zasieg wezla gps:
           % localization_draw_circle(radio_range,S_Map(n,1),S_Map(n,2));
        end
    end
    
end
